FROM ubuntu:14.04.2

# build docker image to package .debs

RUN useradd -m -d /home/debra -s /bin/bash debra

RUN echo "deb http://mirrors.aliyun.com/ubuntu/ trusty main restricted universe multiverse" > /etc/apt/sources.list;\
    echo "deb http://mirrors.aliyun.com/ubuntu/ trusty-security main restricted universe multiverse" >> /etc/apt/sources.list;\
    echo "deb http://mirrors.aliyun.com/ubuntu/ trusty-updates main restricted universe multiverse" >> /etc/apt/sources.list;\
    echo "deb http://mirrors.aliyun.com/ubuntu/ trusty-proposed main restricted universe multiverse" >> /etc/apt/sources.list;\
    echo "deb http://mirrors.aliyun.com/ubuntu/ trusty-backports main restricted universe multiverse" >> /etc/apt/sources.list;\
    apt-get update -y;\
    apt-get upgrade -y;

RUN apt-get install -y build-essential dh-make bzr-builddeb autotools-dev wget

RUN echo "debra ALL = NOPASSWD: /usr/bin/apt-get" > /etc/sudoers.d/debra
USER debra
RUN mkdir -p /home/debra/deb
WORKDIR /home/debra/deb

RUN mkdir -p /home/debra/.bazaar; \
    echo '[DEFAULT]' > /home/debra/.bazaar/bazaar.conf; \
    echo 'email = SkyLothar <allothar@gmail.com>' >> /home/debra/.bazaar/bazaar.conf;
